#include <iostream>
#include <utility>  // For std::forward
#include <string>   // For std::string

class Example {
public:
    Example(int a, double b, const std::string& c) {
        std::cout << "Example created with values: "
                  << a << ", " << b << ", " << c << std::endl;
    }
};

template<typename T, typename... Args>
T* create_object(Args&&... args) {
    return new T(std::forward<Args>(args)...);
}

int main() {
    int a = 42;                   // 左值
    double b = 3.14159;           // 左值
    std::string c = "Hello World"; // 左值

    // 同时传递左值和右值
    Example* myExample = create_object<Example>(a, 2.71828, "Temporary String");

    delete myExample;
    
    return 0;
}